import request from '@/utils/request'

// 查询积分商品列表
export function listReward(query) {
  return request({
    url: '/reward/reward/list',
    method: 'get',
    params: query
  })
}

// 查询积分商品详细
export function getReward(id) {
  return request({
    url: '/reward/reward/' + id,
    method: 'get'
  })
}

// 新增积分商品
export function addReward(data) {
  return request({
    url: '/reward/reward',
    method: 'post',
    data: data
  })
}

// 修改积分商品
export function updateReward(data) {
  return request({
    url: '/reward/reward',
    method: 'put',
    data: data
  })
}

// 删除积分商品
export function delReward(id) {
  return request({
    url: '/reward/reward/' + id,
    method: 'delete'
  })
}
// 修改后的 exchangeReward 接口定义
export function exchangeReward(rewardId) {
  return request({
    url: '/reward/reward/exchange/'+rewardId,
    method: 'put',
  })
}
